<?php
/* @var $this AnalysisController */
//领取地址
$copy_content = Yii::app()->homeUrl.Yii::app()->createUrl('/member/info/getcoupon',array('zti_id'=>$data->zti_id,'amount'=>'1'));

?>
<table class="list_table" cellpadding="0" cellspacing="0" width="100%">
 	<tbody>
		<tr>
			<td width="22%" class="pl15">
				<div class="<?php echo $data->zti_pic?>"><span class="value"><?php echo round($data->zti_value)?></span></div>	
			</td>
			<td width="15%"><?php echo date('Y-m-d H:i',$data->zti_end_time)?></td>
			<td width="10%" class="fw_b c_f60"><?php echo $data->zti_inventory?></td>
			<td width="10%"><?php echo $data->zti_limitget?></td>
			<td width="14%">
				<?php
					if($data->zti_start_time>time()){
						echo "未开始";
					}elseif($data->zti_end_time<=time()){
						echo "已结束";
					}else{
						if($data->zti_status==1){
							if($data->zti_inventory>0){
								echo "领取中";
							}else{
								echo "已领完";
							}
						}elseif($data->zti_status==2){
							echo "已关闭";
						}
					}
				?>
			</td>
			<td width="16%" class="operate">
				<?php if($data->zti_start_time>time()||$data->zti_status==2) echo CHtml::link(Yii::t('glo','Update'),array('updateCoupon','id'=>$data->zti_id),array('class'=>'c_06c'))?>
				<?php if(!($data->zti_start_time<time()&&$data->zti_end_time>time()&&$data->zti_inventory>0&&$data->zti_status==1)) echo CHtml::link(Yii::t('glo','Delete'),'javascript:',array('class'=>'c_06c','onclick'=>'return art_del_confirm("'.$this->pre_module_url.'/promotion/deleteCoupon/id/'.$data->zti_id.'","你确定要删除这条信息吗？")'))//删除?>
				<?php if($data->zti_end_time>time()&&$data->zti_inventory>0) echo CHtml::link(($data->zti_status==1)?Yii::t('cmp','Stop'):Yii::t('cmp','Run'),array('changeCoupon','id'=>$data->zti_id),array('class'=>'c_06c')) //启用、停止?>
				<?php if($data->zti_start_time>time()||($data->zti_start_time<time()&&$data->zti_end_time>time()&&$data->zti_inventory>0&&$data->zti_status==1)) echo CHtml::link(Yii::t('cmp','Copy Code'),'javascript:void(0)',array('id'=>'btnCopy_'.($index+1),'copyContent'=>$copy_content))?>
			</td>
		</tr>
	</tbody>
</table>
 